import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

const routes = [
  {
      path: '/',
      redirect: '/login',
  },
  {
      path: '/home',
      redirect: '/short-lightering',
  },
  {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
  },
  {
      path: '/layout',
      name: 'layout',
      component: () => import('@/layouts/HeaderAsideLayout'),
      children: [
        // 短驳管理
        {
          path: '/short-lightering',
          component: () => import('@/views/short-lightering/index.vue'),
        },
        // 车辆管理
        {
          path: '/vehicle',
          component: () => import('@/views/vehicle/index.vue'),
        },
      ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router;
